package com.example.batterynotification;

import android.app.Activity;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.util.Log;


public class AboutBatteryActivity extends Activity {
		BatteryReceiverForeground batForeGround;
		IntentFilter batIntentFilter;
	 protected void onCreate(Bundle savedInstanceState) {
		  super.onCreate(savedInstanceState);
		    batForeGround = new BatteryReceiverForeground();		
			batIntentFilter = new IntentFilter(Intent.ACTION_BATTERY_CHANGED);		   
		  AboutBatteryFragment prefFragment = new AboutBatteryFragment();
		  android.app.FragmentManager fragmentManager = getFragmentManager();
		  android.app.FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
		  fragmentTransaction.replace(android.R.id.content, prefFragment);
		  fragmentTransaction.commit();
		 }
	 
		@Override
		protected void onResume() {
			// TODO Auto-generated method stub
			super.onResume();
			registerReceiver(batForeGround,batIntentFilter );
		}
	@Override
	protected void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
	    Log.i("LC", "ABOUT BATTERY PAUSED");
		unregisterReceiver(batForeGround);
	}	 
}
